using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


/// <summary>
/// The EmployeeSalaryTransTableManager class is responsible for managing BO.EmployeeSalaryTransTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class EmployeeSalaryTransTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all EmployeeSalaryTransTable objects in the database.
/// </summary>
/// <returns>A list with all EmployeeSalaryTransTable from the database when the database contains any, or null otherwise.</returns>

[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeSalaryTransTableList GetList(int SchoolKey)
{
    return EmployeeSalaryTransTableDB.GetList(SchoolKey);
}

[DataObjectMethod(DataObjectMethodType.Select, true)]
public static EmployeeSalaryTransTableList GetListByUserAccountKey(int UserAccountKey,int SchoolKey)
{
    return EmployeeSalaryTransTableDB.GetListByUserAccountKey(UserAccountKey, SchoolKey);
}

/// <summary>
/// Gets a single EmployeeSalaryTransTable from the database without its data.
/// </summary>
/// <param name="employeeSalaryTransKey">The EmployeeSalaryTransKey of the EmployeeSalaryTransTable in the database.</param>
/// <returns>A EmployeeSalaryTransTable object when the EmployeeSalaryTransKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeSalaryTransTable GetItem(long employeeSalaryTransKey){
return GetItem(employeeSalaryTransKey, false);
}

/// <summary>
/// Gets a single EmployeeSalaryTransTable from the database.
/// </summary>
/// <param name="employeeSalaryTransKey">The EmployeeSalaryTransKey of the EmployeeSalaryTransTable in the database.</param>
/// <param name="getEmployeeSalaryTransTableRecords">Determines whether to load all associated EmployeeSalaryTransTable records as well.</param>
/// <returns>
/// A EmployeeSalaryTransTable object when the EmployeeSalaryTransKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static EmployeeSalaryTransTable GetItem(long employeeSalaryTransKey, bool getEmployeeSalaryTransTableRecords){
EmployeeSalaryTransTable myEmployeeSalaryTransTable = EmployeeSalaryTransTableDB.GetItem(employeeSalaryTransKey);
return myEmployeeSalaryTransTable;
}

/// <summary>
/// Saves a EmployeeSalaryTransTable in the database.
/// </summary>
/// <param name="myEmployeeSalaryTransTable">The EmployeeSalaryTransTable instance to save.</param>
/// <returns>The new EmployeeSalaryTransKey if the EmployeeSalaryTransTable is new in the database or the existing EmployeeSalaryTransKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static long Save(EmployeeSalaryTransTable myEmployeeSalaryTransTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
long employeeSalaryTransTableEmployeeSalaryTransKey = EmployeeSalaryTransTableDB.Save(myEmployeeSalaryTransTable);

//  Assign the EmployeeSalaryTransTable its new (or existing EmployeeSalaryTransKey).
myEmployeeSalaryTransTable.EmployeeSalaryTransKey = employeeSalaryTransTableEmployeeSalaryTransKey;

myTransactionScope.Complete();

return employeeSalaryTransTableEmployeeSalaryTransKey;
}
}

/// <summary>
/// Deletes a EmployeeSalaryTransTable from the database.
/// </summary>
/// <param name="myEmployeeSalaryTransTable">The EmployeeSalaryTransTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(EmployeeSalaryTransTable myEmployeeSalaryTransTable){
return EmployeeSalaryTransTableDB.Delete(myEmployeeSalaryTransTable.EmployeeSalaryTransKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(int EmployeeSalaryTransKey)
{
    return EmployeeSalaryTransTableDB.Delete(EmployeeSalaryTransKey);
}

#endregion

}

